@echo off
REM
REM Builds Hive and copies its program files to the specified directory.
REM

setlocal

set TARGET=%~1
if not defined TARGET (
    echo Usage: ^<install path^>
    exit /b 1
)

"%SYSTEMROOT%\Microsoft.NET\Framework\v3.5\msbuild.exe" "%~dp0src\Hive.sln" /v:quiet
if errorlevel 1 exit /b 1

echo.
echo Copying files to %TARGET%.
copy /Y "%~dp0src\Hive\bin\Hive.exe" "%TARGET%" >nul
if errorlevel 1 exit /b 1
copy /Y "%~dp0src\Hive\bin\Hive.Core.dll" "%TARGET%" >nul
if errorlevel 1 exit /b 1
copy /Y "%~dp0src\Hive\bin\ICSharpCode.SharpZipLib.dll" "%TARGET%" >nul
if errorlevel 1 exit /b 1

exit /b 0
